# mylist =  [1, 4, -5, 10, -7, 2, 3, -1]
# import math
# print([math.sqrt(n) for n in mylist if n>0 ])

addresses = ['5412 N CLARK', '5148 N CLARK', '5800 E 58TH', '2122 N CLARK', '5645 N RAVENSWOOD', '1060 W ADDISON',
             '4801 N BROADWAY', '1039 W GRANVILLE', ]
counts = [0, 3, 10, 4, 1, 7, 6, 1]
from itertools import compress

# 这个写法返回这个列表是否大于5的True和False
# 如果条件写在后面返回的就是大于5值的列表
node5 = [n > 5 for n in counts]
# compress()函数有两个参数第一个是序列,第二个是根据列表的true值
n = list(compress(addresses, node5))
print(n)
